home *** CD-ROM | disk | FTP | other *** search
/ Aminet 50 / Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso / STFax / Install next >
Text File  |  2002-07-31  |  9KB  |  323 lines

  1. ; $VER: STFax-Install 2.0 (17.12.97)
  2. ;
  3. ; Installer script by Simone Tellini <wiz@pragmanet.it>
  4. ; with the help of Ben Preece <beej@bigfoot.com>
  5. ;
  6.  
  7. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8. ;  set initial variables
  9. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  10.  
  11. (set @app-name "STFax Professional")
  12. (set AppDir "STFax")
  13. (set @error-msg "An unexpected error has occured. Installation aborted.")
  14.  
  15. (if (<= (/ (getversion) 65536) 38)
  16.    (set Kick2 1)
  17.    (set Kick2 0)
  18. )
  19.  
  20. (if (exists "STFax:" (noreq))
  21.    (set @default-dest (pathonly (expandpath "STFax:")))
  22. )
  23.  
  24. (complete 0)
  25.  
  26. (welcome)
  27.  
  28. (set InstallDir
  29.    (askdir
  30.       (prompt "Please select where you would like " @app-name " installed.\n"
  31.               "A drawer called '" AppDir "' will be created there.")
  32.       (help "Select where you would like " @app-name " installed. "
  33.             "The installer will then create a drawer called '" AppDir "', "
  34.             "and copy the program and necessary files into it.\n")
  35.       (default @default-dest)
  36.    )
  37. )
  38.  
  39. (Set DestDir        (tackon InstallDir AppDir))
  40. (Set FaxInDir       (tackon DestDir "Fax_In"))
  41. (Set FaxOutDir      (tackon DestDir "Fax_Out"))
  42. (Set ConfigDir      (tackon DestDir "Config"))
  43. (Set LocaleDir      (tackon DestDir "Catalogs"))
  44. (Set ContribDir     (tackon DestDir "Contributions"))
  45. (Set DataDir        (tackon DestDir "Data"))
  46. (Set PicsDir        (tackon DestDir "Pics"))
  47. (Set RexxDir        (tackon DestDir "Rexx"))
  48. (Set ScriptDir      (tackon DestDir "Scripts"))
  49. (Set DocsDir        (tackon DestDir "Docs"))
  50. (Set MessagesDir    (tackon DestDir "Messages"))
  51.  
  52. (set @default-dest  DestDir)
  53.  
  54. (set MainExe "STFax")
  55.  
  56. (makeassign "STFaxInstall" "AMINET50:STFax/STFax")
  57.  
  58.  
  59. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  60. ;  ask registration parameters
  61. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  62.  
  63. (set UserName
  64.     (askstring
  65.         (prompt "Please enter your full name:")
  66.         (help "Enter your full name. This is needed to register your"
  67.               "copy of " @app-name)
  68.     )
  69. )
  70.  
  71. (set UserCompany
  72.     (askstring
  73.         (prompt "Please enter your company name:")
  74.         (help "Enter your company name. This is needed to register your"
  75.               "copy of " @app-name)
  76.     )
  77. )
  78.  
  79. (set UserCode
  80.     (askstring
  81.         (prompt "Please enter your registration code:")
  82.         (help "Enter your registration code. You can find it on your"
  83.               "registration card. Make sure to enter it correctly!")
  84.     )
  85. )
  86.  
  87. (set KeyFile (cat UserName "\n" UserCompany "\n" UserCode))
  88.  
  89. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  90. ;  Create directories
  91. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  92.  
  93. (makedir DestDir)
  94. (makedir LocaleDir  (infos))
  95. (makedir FaxInDir   (infos))
  96. (makedir FaxOutDir  (infos))
  97. (makedir DataDir)
  98. (makedir ConfigDir)
  99. (makedir MessagesDir)
  100. (makedir (tackon MessagesDir "0000"))
  101.  
  102. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  103. ;  Copy files
  104. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  105.  
  106. (if (exists ("STFaxInstall:/STFax.info"))
  107.     (copyfiles
  108.         (source "STFaxInstall:/STFax.info")
  109.         (dest InstallDir)
  110.         (infos)
  111.         (noposition)
  112.     )
  113. )
  114.  
  115. (complete 10)
  116.  
  117. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  118. ;  Copy main file
  119. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  120.  
  121. (copyfiles
  122.    (source (tackon "STFaxInstall:" MainExe))
  123.    (dest DestDir)
  124.    (newname "STFax")
  125. )
  126.  
  127. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  128. ;  copy icons files, if needed
  129. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  130.  
  131.  
  132. (if (= (exists (tackon DestDir "STFax.info")) 0)
  133.     (copyfiles (source "STFaxInstall:STFax.info")       (dest DestDir)   (noposition))
  134. )
  135.  
  136. (if (= (exists (tackon DestDir "STFax.guide.info")) 0)
  137.     (copyfiles (source "STFaxInstall:STFax.guide.info") (dest DestDir)   (noposition))
  138. )
  139.  
  140. (copyfiles (source "STFaxInstall:Catalogs.info")    (dest DestDir)   (noposition))
  141. (copyfiles (source "STFaxInstall:Rexx.info")        (dest DestDir)   (noposition))
  142.  
  143. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  144. ;  copy sub directories
  145. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  146.  
  147. (copyfiles (source "STFaxInstall:Rexx")             (dest RexxDir)   (noposition) (infos) (all))
  148. (copyfiles (source "STFaxInstall:Scripts")          (dest ScriptDir) (noposition) (infos) (all))
  149. (copyfiles (source "STFaxInstall:Pics")             (dest PicsDir)   (all))
  150. (complete 20)
  151. (copyfiles (source "STFaxInstall:Data")             (dest DataDir)   (all))
  152. (copyfiles (source "STFaxInstall:Docs")             (dest DocsDir)   (noposition) (infos) (all))
  153. (complete 40)
  154.  
  155. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  156. ;  move old files in the right position
  157. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  158.  
  159. (if (= (exists (tackon DestDir "NoData.txt")) 1)
  160.     (
  161.         (copyfiles (source (tackon DestDir "NoData.txt")) (dest DataDir))
  162.         (delete (tackon DestDir "NoData.txt"))
  163.     )
  164. )
  165.  
  166. (copyfiles (source "STFaxInstall:STFax.guide")   (dest DestDir))
  167.  
  168. (if Kick2
  169.    (tooltype
  170.       (dest (tackon DestDir "STFax.guide"))
  171.       (setdefaulttool "AmigaGuide")
  172.    )
  173. )
  174.  
  175. (complete 50)
  176.  
  177. (copyfiles
  178.   (source "STFaxInstall:Catalogs")
  179.   (dest LocaleDir)
  180.   (pattern "#?.c?")
  181. )
  182.  
  183. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  184. ;  Install MUI classes
  185. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  186.  
  187. (copylib
  188.        (prompt "Installing some MUI classes...")
  189.        (help   "This will install some MUI classes needed by STFax")
  190.        (source "STFaxInstall:MUI/NFloattext.mcc")
  191.        (dest   "MUI:Libs/MUI")
  192.        (confirm)
  193. )
  194.  
  195. (copylib
  196.        (prompt "Installing some MUI classes...")
  197.        (help   "This will install some MUI classes needed by STFax")
  198.        (source "STFaxInstall:MUI/NList.mcc")
  199.        (dest   "MUI:Libs/MUI")
  200.        (confirm)
  201. )
  202.  
  203. (copylib
  204.        (prompt "Installing some MUI classes...")
  205.        (help   "This will install some MUI classes needed by STFax")
  206.        (source "STFaxInstall:MUI/NListview.mcc")
  207.        (dest   "MUI:Libs/MUI")
  208.        (confirm)
  209. )
  210.  
  211. (copylib
  212.        (prompt "Installing some MUI classes...")
  213.        (help   "This will install some MUI classes needed by STFax")
  214.        (source "STFaxInstall:MUI/NListviews.mcp")
  215.        (dest   "MUI:Libs/MUI")
  216.        (confirm)
  217. )
  218.  
  219. (copylib
  220.        (prompt "Installing some MUI classes...")
  221.        (help   "This will install some MUI classes needed by STFax")
  222.        (source "STFaxInstall:MUI/Textinput.mcc")
  223.        (dest   "MUI:Libs/MUI")
  224.        (confirm)
  225. )
  226.  
  227. (copylib
  228.        (prompt "Installing some MUI classes...")
  229.        (help   "This will install some MUI classes needed by STFax")
  230.        (source "STFaxInstall:MUI/Textinput.mcp")
  231.        (dest   "MUI:Libs/MUI")
  232.        (confirm)
  233. )
  234.  
  235. (copylib
  236.        (prompt "Installing some MUI classes...")
  237.        (help   "This will install some MUI classes needed by STFax")
  238.        (source "STFaxInstall:MUI/Textinputscroll.mcc")
  239.        (dest   "MUI:Libs/MUI")
  240.        (confirm)
  241. )
  242.  
  243. (complete 60)
  244.  
  245. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  246. ;  Install stuff on SYS:
  247. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  248.  
  249. (copyfiles
  250.     (source "STFaxInstall:Devs/Printers/STFaxPrt")
  251.     (dest "DEVS:Printers")
  252. )
  253.  
  254. (copyfiles
  255.   (source "STFaxInstall:Devs/Datatypes")
  256.   (dest "DEVS:Datatypes")
  257.   (pattern "#?")
  258.   (infos)
  259.   (noposition)
  260. )
  261.  
  262. (copylib
  263.        (prompt "Installing STFax.datatype...")
  264.        (help   "This will install the STFax.datatype: it will let "
  265.                "you import STFax faxes into any program that supports "
  266.                "datatypes.")
  267.        (source "STFaxInstall:Classes/Datatypes/STFax.datatype")
  268.        (dest   "SYS:Classes/Datatypes")
  269.        (confirm)
  270. )
  271.  
  272. (complete 70)
  273.  
  274. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  275. ;  Update the user-startup
  276. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  277.  
  278. (startup "STFax"
  279.         (prompt "Editing your S:User-Startup")
  280.         (help   "The Installer will add one assign needed by STFax")
  281.         (command (cat "Assign STFax: \"" DestDir "\" >NIL:"))
  282. )
  283.  
  284. (makeassign "STFax" DestDir)
  285.  
  286. (textfile
  287.     (prompt "Creating your key file")
  288.     (dest "STFax:STFax.key")
  289.     (append KeyFile)
  290. )
  291.  
  292. (complete 80)
  293.  
  294. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  295. ;  install catalogs
  296. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  297.  
  298. (copyfiles
  299.         (prompt "Copying catalog files")
  300.         (help @copyfiles-help)
  301.         (source "STFaxInstall:Catalogs")
  302.         (dest LocaleDir)
  303.         (choices "italiano")
  304.         (confirm)
  305. )
  306.  
  307. (complete 90)
  308.  
  309. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  310. ;  Delete temp files
  311. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  312.  
  313. (working "Removing temporary files...")
  314.  
  315. (run "Assign STFaxInstall: REMOVE")
  316.  
  317. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  318. ;  All done.
  319. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  320.  
  321. (complete 100)
  322.  
  323.